package com.example.brazil_project.util;

import java.util.Timer;
import java.util.TimerTask;

public class TimerUtil {
	
	public static Timer timer = null;
	
	public static void  startTimer(){
		
	}
	
	
	public static void sysTimer(){
		if(TimerUtil.timer ==null){
			TimerUtil.timer = new Timer();
		}
		else{
			
			TimerUtil.timer.cancel();
			TimerUtil.timer = new Timer();
		}
		
		TimerUtil.timer.schedule(new TimerTask() {
	            public void run() {
	            	SystemMsgUtil t = new SystemMsgUtil();
	            	t.getSystemMsg();
	            	ArriveMsgUtil arrivemsgutil = new ArriveMsgUtil();
	            	arrivemsgutil.getArriveMsg();
	            }
	        },12000, 12000);// 设定指定的时间time,此处为2000毫秒
	}
}
